load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

# gazelle:resolve go go github.com/cockroachdb/cockroach/pkg/sql/protoreflect/test //pkg/sql/protoreflect/test

go_library(
    name = "protoreflect",
    srcs = [
        "redact.go",
        "utils.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/protoreflect",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/json",
        "//pkg/util/protoutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_gogo_protobuf//jsonpb",
        "@com_github_gogo_protobuf//proto",
        "@org_golang_google_protobuf//encoding/protojson",
        "@org_golang_google_protobuf//reflect/protodesc",
        "@org_golang_google_protobuf//reflect/protoreflect",
        "@org_golang_google_protobuf//types/dynamicpb",
    ],
)

go_test(
    name = "protoreflect_test",
    size = "small",
    srcs = [
        "main_test.go",
        "utils_test.go",
    ],
    embed = [":protoreflect"],
    deps = [
        "//pkg/geo/geopb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/protoreflect/gprototest",
        "//pkg/sql/protoreflect/test",
        "//pkg/sql/types",
        "//pkg/util/json",
        "//pkg/util/leaktest",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing/tracingpb",
        "@com_github_gogo_protobuf//jsonpb",
        "@com_github_gogo_protobuf//types",
        "@com_github_stretchr_testify//require",
    ],
)
